Thumb

Input Parameters in a Stored Procedures

9/14/2020 7:15:21 AM

Input Parameters in a Stored Procedures: In this code we create stored procedure with id perematar to get the data from salary table by specific id. Now given bellow the example code for create procedure and also execute procedure with perematar:

/*CREATE PROCEDURE*/
CREATE PROCEDURE GetDataByPera @Id int
AS
BEGIN
SET NOCOUNT ON
select * from Salary where Id=@Id;
END
/*Select data with id*/
EXEC GetDataByPera @Id=3;

we can see create a procedure name as “GetDataByPera” and after create then execute the procedure with perematar with Id value.